package org.csmzxy.class2334.timeclass;

import java.time.LocalDate;
import java.time.Period;

public class Example16 {
    public static void main(String[] args){
        LocalDate start = LocalDate.of(2021,8,10);
        System.out.println("开始时间："+ start);
        LocalDate end = LocalDate.of(2023,11,6);
        System.out.println("结束时间："+ end);
        Period period = Period.between(start,end);
        System.out.println("开始时间和结束时间间隔如下。");
        System.out.println("相差年数："+ period.getYears());
        System.out.println("相差月数："+ period.getMonths ());
        System.out.println("相差天数："+ period.getDays());
    }
}
